export enum ContentStatus {
  Pending = 0, // 发表但未审核通过 0
  Reject, // 审核不通过 1
  Accept, // 审核通过 2
  Reported // 被举报成功 3
}

export enum UserRole {
  Student = 0, // 0
  Admin // 1
}

export interface BaseModel {
  createdAt?: string;
  updatedAt?: string;
  deletedAt?: string;
}

export interface WxInfo {
  id: number;
  wxOpenId: string;
  wxSessionKey: string;
  wxUnionId: string;
  user?: User;
}

export interface User extends BaseModel {
  id: number;
  name: string;
  school: string;
  schoolId: string;
  studentType: string;
  studentYear: string;
  shuVerify?: string;
  avatar: string;
  wx?: WxInfo;
  role: UserRole;
  posts?: Post[];
  likePosts?: Post[];
  likeComments?: Comment[];
}

export interface Post extends BaseModel {
  id: number;
  user?: User;
  category?: Category;
  title: string;
  images: string;
  anonymous: boolean;
  content: string;
  upVote: number;
  status: ContentStatus;
  comments?: Comment[];
  likers?: User[];
}

export interface Comment extends BaseModel {
  id: number;
  user: User;
  post: Post;
  parent?: Comment;
  children?: Comment[];
  content: string;
  status: ContentStatus;
  images: string;
  upVote: number;
  likers?: User[];
}


export interface Category extends BaseModel {
  id: number;
  name: string;
  posts?: Post[];
  users?: User[];
}